import BaseEnumFactory from "/@/constant/BaseEnumFactory";

/** 账号信息 */
export default class AccountResponse  { 
  accId!:string;
  accName!:string;
  accType!:EnumStruct<AccountEnum_AccType>;
  userId!:string;
  status!:EnumStruct<AccountEnum_Status>;
  addUser!:string;
  addTime!:string;
  updUser!:string;
  updTime!:string;
  password!:string;

  constructor(){
    this.accType=BaseEnumFactory.AccountEnum_AccType.ORDINARY_ACCOUNT_NUMBER;
    this.status=BaseEnumFactory.AccountEnum_Status.ENABLE;
    
  }

  /**通过JSONObject创建实例对象 */
  public static getInstanceByJSONObj(jsonObj:any):AccountResponse{  
    let instance=new AccountResponse()  
    return Object.assign(instance, jsonObj) 
  }


  /** 通过属性参数创建实例对象 */
  public static getInstanceByParam(accId:string,accName:string
                                   ,accType:EnumStruct<AccountEnum_AccType>,userId:string
                                   ,status:EnumStruct<AccountEnum_Status>,addUser:string
                                   ,addTime:string,updUser:string
                                   ,updTime:string){ 
    let instance=new AccountResponse()  
    instance.accId=accId;
    instance.accName=accName;
    instance.accType=accType;
    instance.userId=userId;
    instance.status=status;
    instance.addUser=addUser;
    instance.addTime=addTime;
    instance.updUser=updUser;
    instance.updTime=updTime;
    return instance 
  }


  /** 类属性的申明静态变量(适用于直接用到Class.fieldName的场景) */
   static fieldNames={ accId:"accId",accName:"accName",accType:{code:"accType.code",value:"accType.value",this:"accType"},userId:"userId",status:{code:"status.code",value:"status.value",this:"status"},addUser:"addUser",addTime:"addTime",updUser:"updUser",updTime:"updTime" } 
}

